package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import org.kailu.book.entity.AuthorEntity;
import org.kailu.book.entity.BillBookDetailsEntity;
import org.kailu.book.entity.CategoryEntity;
import org.kailu.book.entity.ExportBookDetailsEntity;
import org.kailu.book.entity.LanguageEntity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Book generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "book", catalog = "book")
public class BookEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer bookId;
	private AuthorEntity author;
	private LanguageEntity language;
	private CategoryEntity category;
	private String bookName;
	private int bookQuantity;
	private int bookPrice;
	private Set<BillBookDetailsEntity> billBookDetailses = new HashSet<BillBookDetailsEntity>(
			0);
	private Set<ExportBookDetailsEntity> exportBookDetailses = new HashSet<ExportBookDetailsEntity>(
			0);

	public BookEntity() {
	}

	public BookEntity(String bookName, int bookQuantity, int bookPrice) {
		this.bookName = bookName;
		this.bookQuantity = bookQuantity;
		this.bookPrice = bookPrice;
	}

	public BookEntity(AuthorEntity author, LanguageEntity language, CategoryEntity category,
			String bookName, int bookQuantity, int bookPrice,
			Set<BillBookDetailsEntity> billBookDetailses,
			Set<ExportBookDetailsEntity> exportBookDetailses) {
		this.author = author;
		this.language = language;
		this.category = category;
		this.bookName = bookName;
		this.bookQuantity = bookQuantity;
		this.bookPrice = bookPrice;
		this.billBookDetailses = billBookDetailses;
		this.exportBookDetailses = exportBookDetailses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "book_id", unique = true, nullable = false)
	public Integer getBookId() {
		return this.bookId;
	}

	public void setBookId(Integer bookId) {
		this.bookId = bookId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "author_id")
	public AuthorEntity getAuthor() {
		return this.author;
	}

	public void setAuthor(AuthorEntity author) {
		this.author = author;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "language_id")
	public LanguageEntity getLanguage() {
		return this.language;
	}

	public void setLanguage(LanguageEntity language) {
		this.language = language;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "category_id")
	public CategoryEntity getCategory() {
		return this.category;
	}

	public void setCategory(CategoryEntity category) {
		this.category = category;
	}

	@Column(name = "book_name", nullable = false, length = 65535)
	public String getBookName() {
		return this.bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	@Column(name = "book_quantity", nullable = false)
	public int getBookQuantity() {
		return this.bookQuantity;
	}

	public void setBookQuantity(int bookQuantity) {
		this.bookQuantity = bookQuantity;
	}

	@Column(name = "book_price", nullable = false)
	public int getBookPrice() {
		return this.bookPrice;
	}

	public void setBookPrice(int bookPrice) {
		this.bookPrice = bookPrice;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "book")
	public Set<BillBookDetailsEntity> getBillBookDetailses() {
		return this.billBookDetailses;
	}

	public void setBillBookDetailses(Set<BillBookDetailsEntity> billBookDetailses) {
		this.billBookDetailses = billBookDetailses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "book")
	public Set<ExportBookDetailsEntity> getExportBookDetailses() {
		return this.exportBookDetailses;
	}

	public void setExportBookDetailses(
			Set<ExportBookDetailsEntity> exportBookDetailses) {
		this.exportBookDetailses = exportBookDetailses;
	}

}
